﻿//using System;
//using GameEditor.View.Components;
//using GameEngine.Model;
//using GameEngine.View.Components;
//using PureMVC.Interfaces;
//using PureMVC.Patterns;
//using GameEngine;

//namespace GameEditor.Commands
//{
//    /// <summary>
//    /// Pressupões a existência dos restantes mediators
//    /// </summary>
//    public class CreateGameEditor_Command<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView,MyShapeEditorMenuView, MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType> : SimpleCommand
//        where MyGameEditorView : class, IGameEditorView<MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>
//        where MyGameEditorMenuView : class, IGameEditorMenuView<MyIdType>
//        where MyLevelEditorMenuView : class, ILevelEditorMenuView<MyIdType>
//        where MyWorldEditorMenuView : class, IWorldEditorMenuView<MyIdType>
//        where MyMapEditorMenuView : class, IMapEditorMenuView

//        where MyResourceEditorMenuView : class, IResourceEditorMenuView<MyIdType>
//        where MyViewEditorMenuView : class, IViewEditorMenuView<MyIdType>
//        where MyShapeEditorMenuView : class, IShapeEditorMenuView<MyIdType>
//        where MyThingTypeEditorMenuView : class, IThingTypeEditorMenuView<MyIdType>
//        where MyThingEditorMenuView : class, IThingEditorMenuView<MyIdType>
        
//        where MyGameView : class, IGameView<MyIdType, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType>
//        where MyLevelView : class, ILevelView<MyIdType, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType>
//        where MyWorldView : class, IWorldView<MyIdType, MyMapView, MyItemView, MyBaseUIElementType>
//        where MyMapView : class, IMapView<MyIdType, MyItemView, MyBaseUIElementType>
//        where MyItemView : class, IThingView<MyIdType, MyBaseUIElementType>
//        where MyIdType : IComparable<MyIdType>
//    {
//        override public void Execute(INotification notification)
//        {
//            if (notification.Body == null)
//                throw new Exception(this.GetType().Name + " has to have body");

//            var dataProxy = notification.Body as IGameDataProxy<MyIdType>;

//            var levelMenuMediator = GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Helper.GetLevelEditorMenuMediator();
//            var editorMediator = GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView, MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Instance.CreateGameEditorMediator(
//                GameEditorFacade.GameEditorMediatorName,
//                GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Instance.CreateGameEditorView(),
//                dataProxy,
//                ViewFacade<MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyIdType, MyBaseUIElementType>.Helper.GetWorldMediator(levelMenuMediator.SelectedWorld),
//                //ViewFacade<MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyIdType, MyBaseUIElementType>.Helper.GetGameMediator(),
//                GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView, MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Helper.GetGameEditorMenuMediator(),
//                levelMenuMediator,
//                GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Helper.GetWorldEditorMenuMediator(),
//                GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Helper.GetMapEditorMenuMediator(),
//                //GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Helper.GetResourceEditorMenuMediator(),
//                //GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Helper.GetViewEditorMenuMediator(),
//                //GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Helper.GetThingTypeEditorMenuMediator(),
//                GameEditorViewFacade<MyGameEditorView, MyGameEditorMenuView, MyLevelEditorMenuView, MyWorldEditorMenuView, MyMapEditorMenuView, MyResourceEditorMenuView, MyViewEditorMenuView, MyShapeEditorMenuView,MyThingTypeEditorMenuView, MyThingEditorMenuView, MyGameView, MyLevelView, MyWorldView, MyMapView, MyItemView, MyBaseUIElementType, MyIdType>.Helper.GetThingEditorMenuMediator(),
//                notification.Type
//                );

//            //editorMediator.Name = dataProxy.Name;
//            //editorMediator.MaxMapHeight = dataProxy.MaxHeight;
//            //editorMediator.MinMapHeight = dataProxy.MinHeight;
//            //editorMediator.TileHeightUnit = dataProxy.TileHeightUnit;
//            //editorMediator.TileSize = dataProxy.TileSize;

//            //foreach (var obj in dataProxy.Levels)
//            //    editorMediator.AddLevel(obj.Key);

//            //foreach (var obj in dataProxy.Resources)
//            //    editorMediator.AddResource(obj.Key);

//            //foreach (var obj in dataProxy.ThingTypes)
//            //    editorMediator.AddThingType(obj.Key);

//            //foreach (var obj in dataProxy.Views)
//            //    editorMediator.AddView(obj.Key);

//            //foreach (var obj in dataProxy.ViewStates)
//            //    editorMediator.AddViewState(obj);

//            Facade.RegisterMediator(editorMediator);
//        }
//    }
//}
